This invention relates in general to communications and more particularly to a system and method for communicating video data in a digital media device.
Many digital media devices are configured to receive incoming data generated. outside the devices and to communicate outgoing video data from the devices. The software applications within such devices have often used access structures such as application programming interfaces (APIs) to communicate information relating to this video data with the software that is more closely associated with the operating system and video subsystem hardware of these devices. Such APIs have typically treated incoming and outgoing video data streams in different manners, have strictly dictated the manner in which memory is allocated to buffers that contain the video data, and have provided two separate messaging structures even for outgoing video dataxe2x80x94one for sending pointers to buffers containing video data and another for sending control messages to manipulate parameters of that video data.
For example, for the outgoing video data, previous devices have provided a send queue containing application-generated references to particular buffers that are individually allocated within memory and filled with the outgoing video data to be communicated. A receive queue returns the references to the application after the video data has been communicated from the device so that the application can then de-allocate the memory for the buffers. However, the incoming video data has been handled quite differently. For example, for incoming video data, previous devices have pre-allocated a pool of buffers and merely selected randomly or sequentially from the many available buffers in this pool, filled these buffers with the incoming video data, and sent the application messages identifying the buffers that have been filled. The application receives this message, accesses the video data in the specified buffer for processing, and returns the buffer to the pool for reuse.
In addition to requiring software for incoming video data to be developed and debugged separately from the software for outgoing video data, such systems do not allow application developers to determine the memory allocation strategy to be used with respect to the buffersxe2x80x94the APIs within these systems strictly dictate how the memory is to be allocated. Nor do such systems allow buffers to be shared among multiple video data streams. Moreover, previous systems do not provide adequate synchronization between control information and corresponding incoming video data, do not allow outgoing and incoming video data rates to be precisely and efficiently decreased, and do not allow timestamps associated with communication or receipt of different video data units to be meaningfully compared across multiple components within a system. These and other disadvantages have often made prior techniques inadequate for many video communication needs and environments.
According to the present invention, problems and disadvantages associated with prior techniques for communicating video data have been substantially reduced or eliminated.
In one embodiment of the present invention, a system for communicating video data in a digital media device includes an application layer having one or more applications and a device driver layer associated with an operating system and video hardware of the digital media device. A video abstraction layer (VAL) coupled to the application layer and the device driver layer includes a send queue containing ordered references to buffers that are each capable of containing video data. The VAL also includes a receive queue containing ordered references to buffers each operable to contain video data. The send and receive queues are used in substantially the same manner for both incoming video data received into the digital media device and outgoing video data to be communicated from the digital media device.
In a more particular embodiment, the buffers are allocated in a memory of the digital media device according to a memory allocation strategy, the VAL not dictating the memory allocation strategy. In another more particular embodiment, at least some of the buffers are shared among two or more video paths. In another more particular embodiment, the send queue further contains at least one control instruction for manipulating at least one parameter of video data for one or more buffer references that follow the control instruction in the send queue. In yet another more particular embodiment, the references in the receive queue include timestamps associated with communication of corresponding video data into or out of the digital media device, as the case may be.
The present invention provides a number of important technical advantages over prior techniques. The queue framework within the VAL allows incoming and outgoing video data to be treated in substantially the same manner. Using the same queue framework for both incoming and outgoing video data also provides a unified programming model for input and output video data and control paths, which makes application development and debugging simpler, faster, and more economical than with previous systems. The present invention also allows application developers to maintain direct control over the memory allocation strategies to be used with respect to the buffers, in contrast to previous systems. The present invention also provides synchronization of path control instructions with references to the buffers, for both input and output, to provide frame-accurate, field-accurate, or other video-data-unit-accurate control not available with previous systems. The use of a common queue framework for both incoming and outgoing video data also allows applications to interact with multiple input/output (I/O) devices that share buffers (which may be sized, aligned, or otherwise registered to be suitable for all I/O devices of interest) between their respective video channels. Furthermore, the present invention allows the outgoing and incoming video data rates to be precisely and efficiently decreased using dummy buffer references, and allows timestamps associated with video data units to be meaningfully compared across multiple components in a system. These and other technical advantage make the present invention well suited for modem digital media devices and video data communications environments. Other technical advantages are readily apparent to those skilled in the art.